
package util;

import java.util.ArrayList;

/**
 * @author Sebastian
 * @author Gottschalk
 * @author Piesold
 */
public enum EngineType {

	DIESEL   ( "Diesel"  ),
	GASOLINE ( "Benzin"  );


	private String name;

	/**
	 * @param name the name
	 */
	private EngineType(String name) {
		this.name = name;
	}

	/**
	 * @return the name of the <code>EngineType</code>
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return an <code>ArrayList< EngineType ></code> with all possible <code>EngineType</code>s
	 */
	public static ArrayList<EngineType> getAll() {
		ArrayList<EngineType> list = new ArrayList<EngineType>();
		for (EngineType e : EngineType.class.getEnumConstants())
			list.add(e);
		return list;
	}

	public static EngineType find( String engineType ) {
		EngineType et = null;
		for (EngineType e : EngineType.class.getEnumConstants())
			if ( e.getName().equalsIgnoreCase( engineType ) )
				et = e;
		return et;
	}

}